package user;

import book.BookList;
import operation.IOPeration;

//所以，该类就成为抽象类
public abstract class User {
    protected String name;
    protected IOPeration[] ioPerations;

    public User(String name) {
        this.name = name;
    }

    //因为不能准确的表达子类的用途，所有要用abstract修饰。
    public abstract int menu();

    //根据你的 choice 下标，功能，去创建了相应的功能类，去调用他的方法(work,参数是书架，去操纵书架，)
    public void doWork(int choice, BookList bookList){
        //this.ioPerations[choice] 拿到的是某个对象
        this.ioPerations[choice].work(bookList);
    }
}
